<!DOCTYPE HTML>
<html lang="en-US">
<head>
	<meta charset="UTF-8">
	<title>js-function-extend</title>
</head>
<body>
	
</body>
</html>
<script type="text/javascript">
var extend = (function(){
	for(var p in {toString: null}){
		return function extend(o){
			for(var i = 1; i < arguments.length; i++){
				var source = arguments[i];
				for(var prop in source) o[prop] = source[prop];
			}
			return o;
		};
	}
	
	return function patched_extend(o){
		for(var i = 1; i < arguments.length; i++){
			var source = arguments[i];
			for(var prop in source) o[prop] = source[prop];
			
			for(var j = 0; j < protoprops.lenght; j++){
				prop = protoprops[j];
				if(source.hasOwnProperty(prop)) o[prop] = source[prop];
			}
		}
		return o;
	};
	
	var protoprops = ['toString', 'valueOf', 'constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString'];
}());
</script>